package com.chuyu.jzwboa.model.models.launcher;

import android.content.Context;

import com.chuyu.jzwboa.model.imodel.launcher.ILauncherModel;
import com.chuyu.jzwboa.utils.sys.PermissionsChecker;

/**
 * @author 杨仕俊
 * @description 启动界面的model具体实现
 * Created by wo on 2017/12/14.
 */

public class LauncherModel implements ILauncherModel {

    private static LauncherModel model;

    private LauncherModel(){}

    public static LauncherModel getInstance(){
        if (model==null){
            model=new LauncherModel();
        }
        return model;
    }

    @Override
    public void detectionPermissions(Context context, IPermissionLisenter iPermissionLisenter, String... permissions) {
        PermissionsChecker mPermissionsChecker = new PermissionsChecker(context);
        // 缺少权限时, 进入权限配置页面
        if (mPermissionsChecker.lacksPermissions(permissions)) {
            //startPermissionsActivity();
            //没有权限
            iPermissionLisenter.notPermission();
        } else {
            //mHandler.sendEmptyMessageDelayed(APP_HANDLER, SPLASH_DELAY_MILLIS);
            //有权限
            iPermissionLisenter.hasPersmission();
        }
    }
}
